1. Field of the Invention
The present invention relates to an image processing method and apparatus for performing an image correction process in accordance with a histogram of an image, and to a storage medium storing program codes for executing such a method.
2. Related Background Art
With recent high-speed personal computers, accelerated growth of high capacity memories, and particularly widespread of digital cameras and photograph scanners, a photograph can be digitalized easily even by general people. Chances of dealing with digital data of photographic images on a personal computer are increasing. A price of an output apparatus, typically an ink jet printer, is becoming low and general people's demands for outputting an image of a photograph at home is rapidly increasing.
However, an input photographic image is often associated with factors of degrading the quality of an output image such as color fogging, from the following reasons. For example, an image taken with a CCD of a digital camera contains wavelength of infrared light or the like insensitive to human eyes. Although an infrared cut filtering process is performed, this process is not fully perfect and color balance correction performed in a digital camera has constraints on a CPU and a real time process, which may result in a loss of the whole color balance. Further, although human eyes can look at a subject by correcting (adapting to) a difference of light source colors, a digital camera records a difference of light source colors on a film as it is. Therefore, even if the camera reproduces a photometrically correct color, color fogging occurs in some cases. Similar phenomenon may occur at a photograph scanner and a flat head scanner, so that even with the best conditions of an image on a negative film or a reversal film, a digitalized image may contain unbalanced color.
Furthermore, if a scene including a fair blue sky in most of the background is taken with a general camera as well as a digital camera under AE, under-exposure is likely to occur so that the whole image is dark and the main subject is not taken under the best conditions. In order to prevent such outputs, various color correction processes have been proposed in various fields, particularly in the photographic print field. More specifically, when a film taken with a silver salt camera is printed on a photographic paper at a photographic laboratory, generally each scene is automatically analyzed and corrected.
Consider next the case wherein RGB signals from an input apparatus are printed via a personal computer by an output apparatus, typically an ink jet printer. Color matching between the input and output apparatuses on the XYZ color space of CIE is performed, for example, by color sink of Macintosh of Apple Computer, Inc. or ICM of Windows of Microsoft Corporation. It is, however, very difficult to perform such adjustment strictly. This is because the input and output apparatuses have different color reproduction ranges and are different in their operation principles that the input apparatus uses R, G and B color signals and the output apparatus uses a reflection original of C, M, Y and K. In addition, if an image taken with the input apparatus is not satisfactory, a print reproduced even with high fidelity does not satisfy user's requirements. Namely, in order to obtain a good print result of an input image with poor exposure or unbalanced color caused by color fogging, the input image data itself is required to be corrected. In this context, an easier correction method has been desired which provides a sufficiently high process speed and does not require a cumbersome work by a user. In any case, it is a main issue that a definite algorithm for color balancing is not still developed.
There are some images which should not be corrected. For example, when an image is took with a camera mounted with a color filter, typically an LB filter, this means that the photographer intentionally wishes color fogging. Sepia image data having boomed recently or the like should also avoid hue correction. Therefore, such images intending special effects should avoid image correction such as removal of color fogging.
Another problem associated with correction of a photograph (image picture), a text, an image mixed with graphics such as figures and drawings, is that image correction for providing a good output result of an image picture is not proper if it is performed for graphics images or the like.